/*
 * Created by JFormDesigner on Fri Apr 16 09:18:53 CST 2021
 */

package window;

import net.miginfocom.swing.MigLayout;

import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * @author unknown
 */
public class GUIStarter extends JFrame {


    public GUIStarter() {
        initComponents();
    }

    private void button2MouseClicked(MouseEvent e) {
        // TODO add your code here
        label1.setText("button Click");
    }

    private void button2KeyPressed(KeyEvent e) {
        // TODO add your code here
        label1.setText("button Click");
    }

    private void initComponents() {
        this.setVisible(true);
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        // Generated using JFormDesigner Evaluation license - zhulinzhong
        label1 = new JLabel();
        button2 = new JButton();
        radioButton1 = new JRadioButton();
        radioButton2 = new JRadioButton();
        button3 = new JButton();

        //======== this ========
        setBackground(new Color(204, 255, 204));
        Container contentPane = getContentPane();
        contentPane.setLayout(new MigLayout(
            "hidemode 3",
            // columns
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]" +
            "[fill]",
            // rows
            "[]" +
            "[]" +
            "[27]" +
            "[]" +
            "[]" +
            "[]" +
            "[]" +
            "[]" +
            "[]" +
            "[]" +
            "[]" +
            "[]"));

        //---- label1 ----
        label1.setText("text");
        contentPane.add(label1, "cell 6 1 4 2");

        //---- button2 ----
        button2.setText("text");
        button2.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                button2MouseClicked(e);
            }
        });
        addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent e) {
                button2KeyPressed(e);
            }
        });
        contentPane.add(button2, "tag next,cell 3 5");

        //---- radioButton1 ----
        radioButton1.setText("text");
        contentPane.add(radioButton1, "cell 0 6");

        //---- radioButton2 ----
        radioButton2.setText("text");
        contentPane.add(radioButton2, "cell 1 6");

        //---- button3 ----
        button3.setText("text");
        contentPane.add(button3, "cell 3 6");
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    // Generated using JFormDesigner Evaluation license - zhulinzhong
    private JLabel label1;
    private JButton button2;
    private JRadioButton radioButton1;
    private JRadioButton radioButton2;
    private JButton button3;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
